#include <bits/stdc++.h>

using uint=unsigned int;
using ll=long long;
using ull=unsigned long long;
using i128=__int128;

const int N=1e6+5;

void Solve(){
   
   return;
}

int main(){
   std::ios::sync_with_stdio(false);
   std::cin.tie(nullptr); std::cout.tie(nullptr);
   int t;
   std::cin>>t;
   while(t--){
      std::string s1,s2,s3;
      std::cin>>s1>>s2>>s3;
      std::string s4;
      s4+=s1[0];
      s4+=s2[0];
      s4+=s3[0];
      std::cout<<s4<<std::endl;
   }

   return 0;
}